package org.flexthinker.binding.value.support
{
    import flash.events.Event;
    import flash.events.EventDispatcher;

    import mx.collections.ArrayCollection;

    /**
     * Bean used to test changes in properties
     */
    public class MockBean extends EventDispatcher
    {
        [Bindable]
        public var simpleString:String;

        public var unbindableString:String;

        [Bindable]
        public var simpleNumber:Number;

        [Bindable]
        public var simpleInt:int;

        [Bindable]
        public var simpleBoolean:Boolean;

        [Bindable]
        public var simpleList:ArrayCollection;

        [Bindable]
        public var bindableProperty:String;

        [Bindable]
        public var objectHolder:Object;

        private var _setOnlyProp:String;

        protected var _readOnlyProp:String = "readOnlyProp";


        private var _bindablePropertyWithCustomEvent:String;

        public function MockBean()
        {
        }

        [Bindable(event="myCustomEvent")]
        public function get bindablePropertyWithCustomEvent():String
        {
            return _bindablePropertyWithCustomEvent;
        }

        public function set bindablePropertyWithCustomEvent( value:String ):void
        {
            _bindablePropertyWithCustomEvent = value;
            dispatchEvent(new Event("myCustomEvent"));
        }

        public function set setOnlyProp(value:String):void
        {
            _setOnlyProp = value;
        }

        public function get getOnlyProp():String
        {
            return _readOnlyProp;
        }
    }
}